package org.spring.springboot.service.impl;

import org.apache.ibatis.annotations.Param;
import org.spring.springboot.dao.SymbolDao;
import org.spring.springboot.domain.Symbol;
import org.spring.springboot.service.ISymbolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SymbolServiceImpl implements ISymbolService {

    @Autowired
    private SymbolDao dao;

    public List<Symbol> selectAll(String userid) {
        List<Symbol> list = dao.selectAll(userid);
        return list;
    }

    public Symbol selectOne(String uuid) {
        return dao.selectOne(uuid);
    }

    public void save(Symbol graphFile) {
        dao.save(graphFile);
    }

    public void updateData(String uuid, String data, String iconURL) {
        dao.updateData(uuid, data, iconURL);
    }

    public void updateProfile(String uuid, String name, String iconURL) {
        dao.updateProfile(uuid, name, iconURL);
    }

    public void delete(String uuid) {
        dao.delete(uuid);
    }
    public  List<Symbol> getSymbolByClass(String userid,String category){
        List<Symbol> list = dao.getSymbolByClass(userid,category);
        return list;
    }

    public  int getCount(@Param("userid") String userid, @Param("category") String category){
        return dao.getCount(userid,category);
    }
}
